<%@page import="com.sun.xml.internal.txw2.Document"%>
<%@page import="java.rmi.Naming"%>
<%@page import="server.ForumHandlerInt"%>
<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<%@ include file="scripts.jsp" %>

<!-- this script is notifing the user about his friends -->

<script type="text/javascript" src="jquery.js"></script>

<script type="text/javascript">
function loadXMLDoc()
{
	
var xmlhttp;
var params;
params = "forumName="+document.addForum.forumName.value;
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }

  
xmlhttp.open("POST","addForumVa.jsp",false);

//Send the proper header information along with the request
xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlhttp.setRequestHeader("Content-length", params.length);
xmlhttp.setRequestHeader("Connection", "close");


xmlhttp.send(params);


if (xmlhttp.status != 200)
{
	document.write(xmlhttp.responseText);
	return "false"
}

return xmlhttp.responseText;
}
</script>






<!-- script for validating forms fields are all filled -->
<script type="text/javascript">
function validate_form( )
{
    valid = true;

    if ( document.addForum.forumName.value == "" )
    {
        alert ( "Please fill in the 'forum name' box." );
        valid = false;
        return valid;
    }
    
    var result = loadXMLDoc();
    
    if (result=="false")
    	return false;
    
    return valid;
}
</script>




<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>add forum</title>
   <link href="styles.css" rel="stylesheet" type="text/css">
    <link href="tableDesign.css" rel="stylesheet" type="text/css">
    <script language="JavaScript" type="text/JavaScript">
		<!--
		function MM_preloadImages() { //v3.0
		  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
			var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
			if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
		}
		-->
	</script>
    
</head>
















 <body link="#6C8EBD">
<div id="main"> 
	<div id="header">
		<div id="logo"><img src="Images/logo1.jpg" alt="logo" width="490" height="182"></div>
		<div id="picture"><img src="Images/Logo2.jpg" alt="pic" width="289" height="156"></div>
	</div>
	<div id="line"><img src="Images/line.jpg" alt="line" width="779" height="4"></div>
    <div id="navigation">
		CREARE NEW FORUM
	</div>
	<div id="line2"><img src="Images/line.jpg" alt="line" width="779" height="4"></div>
	<div id="text" ice:editable="*">
		<div id="bar">
			<div class="bluetxt" id="linktxt">
            		<p><a class="bluetxt" href="mainScreen.jsp">main screen</a></p>
	  			  <p><a class="bluetxt" href="index.jsp"  target="_top" onClick= "logoutFunc();">logout</a>  </p>
			</div>
		</div>
		<div id="text2">
			<div class="contentTXT" id="text2txt">
                <form id="addForumForm" name ="addForum" action="mainScreen.jsp" method="post" onsubmit="return validate_form ( );">
                  <table width="283" border="0">
                      <tr>
                        <th width="120" scope="row">forum name</th>
                        <td width="153"><input name="forumName" type="text" maxlength="45" value="" /></td>
                      </tr>
                    </table>
                    <input name="addForum" type="submit" value="add forum" />
                    
                
                </form>   
			</div>
		</div>
	</div>
<div id="Num"><img src="Images/line.jpg" alt="line" width="779" height="4"></div>
<div id="footer">
<div class="footerTXT" id="footertxt"><a class="footerTXT">Designed by ariel nir yuri gilad itzhaki and marina</a> </div>   </div>
</div>
</div>

</body>
</html>